Some microcontrollers and other devices are operable to receive power from any one of multiple power supplies. For example, in some cases, a microcontroller is operable to be powered from either a main power supply or a battery backup power supply. The microcontroller can be switched between a first VDD supply pin to receive power from the main power supply and a second VBAT supply pin to receive power from the battery backup supply. The back-up battery power supply can be used, for example, if the microcontroller detects that the voltage for the main power supply falls below a threshold level, such as during a loss of main power. In such situations, it is desirable to monitor the main power supply to determine when main power is restored, or when main power supply is above the threshold level, so that the microcontroller can exit the battery backup mode.